import { useState } from "react";



const App = () => {
    const restlt = useState(1);
    const [num,setNum] = restlt
    const clickHandler = () => {
        setNum((prevCounter)=>{
            return prevCounter + 1;
        })
        console.log(num);
    }
    return <div>
        {num}
        <br/>
        <div>
           <button onClick={clickHandler}>+1</button>
        </div>
    </div>
};

export default App;
